<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class GoodslistController extends Controller
{
    
   public function getIndex($id)
   {

   		//dd($id);

 

   	$goods = DB::table('goods')
   	->join('guige','guige.gid','=','goods.id')
   	->join('kucun','kucun.gid','=','goods.id')
   	->where('goods.cateid',$id)->groupBy('goods.id')->get();
   	//dd($goods);
   	return view('home.goodslist',['goods'=>$goods]);

   }
}